package clases.notas;

import CapaDatos.DataSource;
import CapaDatos.Sql;
import javax.swing.JComboBox;
/**
 *
 * @author Jose Daniel
 */
public class Quimestre {
    private int idquimestre;
    private String quimestre;
    private DataSource dt;

    public Quimestre() {
        dt=new DataSource();
    }
    

    public int getIdquimestre() {
        return idquimestre;
    }

    public void setIdquimestre(int idquimestre) {
        this.idquimestre = idquimestre;
    }

    public String getQuimestre() {
        return quimestre;
    }

    public void setQuimestre(String quimestre) {
        this.quimestre = quimestre;
    }
    
    public void llenarQuimestre(JComboBox cbo){
      
     Sql.getConsulta("SELECT NOMBRE FROM QUIMESTRE", dt);
     cbo.removeAllItems();
     cbo.addItem("--Seleccione--");
     while(dt.next()){
         cbo.addItem(dt.getString(1));
     
     }
     
      
    }
     public int getIdQuimestre(){
      return Integer.parseInt(Sql.getDato("IDQUIMESTRE", "QUIMESTRE", "NOMBRE='"+quimestre+"'"));
     }
    
}
